const mongoose = require('mongoose');
const CONNECT_URL = 'mongodb://localhost:27017/xingye'

mongoose.connect(CONNECT_URL)

mongoose.connection.on('connected', () => {
  console.log('连接数据库成功')
})

mongoose.connection.on('disconnected', () => {
  console.log('没有连接上数据库')
})

mongoose.connection.on('error', () => {
  console.log('连接出错')
})

module.exports = mongoose
